package com.heima.common.exception;

import com.heima.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author TheCai
 * @date 2021/5/23 20:15
 **/
public class CustomException extends RuntimeException{

    private AppHttpCodeEnum appHttpCodeEnum;

    public CustomException(AppHttpCodeEnum appHttpCodeEnum){
        this.appHttpCodeEnum =appHttpCodeEnum;
    }
    public CustomException(AppHttpCodeEnum appHttpCodeEnum,String msg){
        appHttpCodeEnum.setErrorMessage(msg);
        this.appHttpCodeEnum =appHttpCodeEnum;
    }
    public AppHttpCodeEnum getAppHttpCodeEnum(){
        return appHttpCodeEnum;
    }

}
